cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

#
# Make a version file containing the current version from git.
#
set (VERSION_MAJOR 2)
set (VERSION_MINOR 1)
set (VERSION_PATCH 0)
include(GetOcsswVersion)

find_package(LibBin++ REQUIRED)
include_directories(${LibBin++_INCLUDE_DIRS})

find_package(LibL2 REQUIRED)
include_directories(${LibL2_INCLUDE_DIRS})
set(LIBS ${LibL2_LIBRARIES})

find_package(GeoTIFF REQUIRED)
include_directories(${GeoTIFF_INCLUDE_DIRS})
list(APPEND LIBS ${GeoTIFF_LIBRARIES})

find_package(PNG REQUIRED)
include_directories(${PNG_INCLUDE_DIRS})
list(APPEND LIBS ${PNG_LIBRARIES})

find_package(Proj4 REQUIRED)
include_directories(${Proj4_INCLUDE_DIRS})
list(APPEND LIBS ${Proj4_LIBRARIES})

add_executable(l3mapgen
  OutFile.cpp
  l3mapgen.cpp
  l3mapgen_input.cpp
  )
  
add_executable(l3mapgen64
  OutFile64.cpp
  l3mapgen64.cpp
  l3mapgen_input.cpp
  )

target_link_libraries(l3mapgen
  ${LibBin++_LIBRARIES}
  ${LIBS}
  )

target_link_libraries(l3mapgen64
  ${LibBin64++_LIBRARIES}
  ${LIBS}
  )

install (TARGETS l3mapgen l3mapgen64 DESTINATION bin)
